home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / serverlib / Makefile < prev    next >
Encoding:
Makefile  |  1996-05-05  |  4.0 KB  |  155 lines

  1. #
  2. # $RCSfile: Makefile,v $ 
  3. # $Revision: 2.57 
  4. # $ $Date: 1996/05/04 21:55:33 $
  5. #
  6. MODULE = serverlib
  7. PARENT= src
  8. PATHTOROOT=..
  9. EXECS=
  10. FILESC=
  11. FILESH=
  12. FILESO=
  13. SPECIALINCLUDE=
  14. LOCALCLEANFILES=formatdisk
  15. LOCALRCSFILES=
  16. MAKEFILES = Makefile makefile.subdir 
  17. LITTLEMAKEFILE=true
  18. #
  19. #modules to get from the baseline
  20. #
  21. MOD_BASELINE =
  22.  
  23. #
  24. #modules in the local work space
  25. #
  26. MOD_WORKSPACE = admin analyze bf bitmap bm btree cl common disk\
  27.     distr fi include io log lg lhash lm mr msg recover redo resource\
  28.     sharedcode sm sync thread trace trans util undo 
  29.  
  30. #
  31. # SPECIALFILESO is a list of *all* the subdir $(MODULE).o files
  32. #     It's needed for making a server library ** in the baseline** directory
  33. #     w/o doing a 'find' (as is done with target $(SLIB)).
  34. #   If we were to use the target $(SLIB) in the baseline, we'd get
  35. #    "multiply  defined" errors for everything.
  36. SPECIALFILESO =  admin/admin.o analyze/analyze.o \
  37.           bitmap/bitmap.o bm/bm.o bf/bf.o btree/btree.o\
  38.           cl/cl.o common/common.o \
  39.           disk/disk.o distr/distr.o fi/fi.o io/io.o redo/redo.o log/log.o lg/lg.o \
  40.           lhash/lhash.o lm/lm.o mr/mr.o msg/msg.o recover/recover.o \
  41.           resource/resource.o \
  42.           sm/sm.o thread/thread.o trace/trace.o trans/trans.o \
  43.           sync/sync.o undo/undo.o util/util.o sharedcode/sharedcode.o 
  44.  
  45.  
  46. COPIES = $(BASELINE)/$(PARENT)/$(MODULE)/formatdisk
  47.  
  48. LINKS = $(PATHTOROOT)/formatvolume/formatvol$(SUFFIX) \
  49.     $(PATHTOROOT)/diskproc/$(DISKRW) \
  50.     $(PATHTOROOT)/server/$(SERVER) 
  51.  
  52. OTHERTAGS=$(PATHTOROOT)/include/tags $(PATHTOROOT)/common/tags\
  53.     $(PATHTOROOT)/diskproc/tags\
  54.     $(PATHTOROOT)/formatvolume/tags\
  55.     $(PATHTOROOT)/server/tags
  56.  
  57. #
  58. # This should be a library, but it's sooooo big that we haven't enough
  59. # disk space for the temp files required by ar(1).
  60. #
  61. SLIB = libsm_server.a
  62.  
  63. defaultTarget: workspace.mod
  64.  
  65. include makefile.depend
  66.  
  67. #
  68. # $(SLIB) ***MUST*** appear before $(LINKS) in this dependency
  69. # or we can get a circular dependency (with the targets of the links
  70. # depending on libsm_server.a)
  71. # For the same reason, this dependency must come before makefile.common
  72. # is included, because makefile.common has a workspace.mod depending on LINKS.
  73. #
  74.  
  75. include $(PATHTOROOT)/makefile.common
  76.  
  77. workspace.mod:     $(SLIB) sdbx $(LINKS)
  78.  
  79. $(SLIB):  workspace.mod.recursive $(PATHTOROOT)/common/common.o link
  80.     @echo making $(MODULE) with flags $(DEBUGFLAGS)
  81.  
  82. link load loadall:
  83.     -rm -f $(SLIB)
  84.     $(AR) crl $(SLIB) $(PATHTOROOT)/common/common.o \
  85.         `find $(MOD_WORKSPACE) $(BASELINE_OBJS) -name "*.o" -print`
  86.     ranlib $(SLIB)
  87.  
  88. cleaninstall:
  89.     -rm -f $(SLIB)
  90.  
  91. install:
  92. #    
  93.     -chmod +w $(LIBDIR)/$(SLIB)
  94.     rm -f $(LIBDIR)/$(SLIB)
  95.     cp $(SLIB) $(LIBDIR)
  96.     ranlib $(LIBDIR)/$(SLIB)
  97.     chmod -w $(LIBDIR)/$(SLIB)
  98.  
  99.  
  100. getbaseline: links $(COPIES) include
  101.     -ln -s $(BASELINE)/$(PARENT)/$(MODULE)/tags .
  102.     -ln -s $(BASELINE)/$(PARENT)/$(MODULE)/$(SLIB) .
  103.     (cd include; $(MAKE) getbaseline)
  104.  
  105. sdbx:
  106.     rm -f $@
  107.     echo  dbx \\ > $@
  108.     for i in `echo $(MOD_WORKSPACE)`; do ( \
  109.         echo -I $(PATHTOROOT)/$(MODULE)/$$i \\ >> $@ \
  110.     ); done;
  111.     for i in `echo $(MOD_BASELINE)`; do ( \
  112.         echo -I $(BASELINE)/$(PARENT)/$(MODULE)/$$i \\ >> $@ \
  113.     ); done;
  114.     @echo \$$\* >> $@
  115.     @chmod +x $@
  116.  
  117.  
  118. baseline.mod :
  119.     @echo "making $(MODULE) "
  120.     @for i in ${MOD_WORKSPACE}; \
  121.         do (cd $$i; $(MAKE) "CC = $(CC)" $$i.o); done;
  122.     @echo ld -r ~~~ -o $(SLIB)
  123.     ld -r $(SPECIALFILESO) -o $(SLIB)
  124.  
  125. formatvol : $(SLIB)
  126.     @(cd $(PATHTOROOT)/formatvolume; $(MAKE) "CC = $(CC)" $@; )
  127.  
  128. diskrw : $(SLIB)
  129.     @(cd $(PATHTOROOT)/diskproc; $(MAKE) "CC = $(CC)" $@; )
  130.  
  131. mr_stub :
  132.     (cd mrserver; $(MAKE) "CC = $(CC)" $@; )
  133.  
  134. touch: touch.local
  135. touch.local:
  136.     touch $(SLIB) 
  137.  
  138. depend: localdepend
  139.  
  140. #
  141. # The following causes $(SLIB) to be remade if any of the subdirs
  142. # were remade since $(SLIB) was last made.  But it doesn't make
  143. # $(SLIB) depend on the sources in the subdirs.  This is about all
  144. # we can do,  short of naming every source file in the whole bloomin'
  145. # library.
  146. #
  147. localdepend:
  148.     touch makefile.depend
  149.     for i in `echo $(MOD_WORKSPACE)`;\
  150.         do\
  151.             echo "$(SLIB):    $$i/$$i.o" >> makefile.depend;\
  152.             echo "$$i/$$i.o:; cd $$i; \$$(MAKE) workspace.mod" >> makefile.depend;\
  153.             done;
  154.  
  155.